package com.briup.labs.mapper;

import com.briup.labs.pojo.SysRole;
import com.briup.labs.pojo.SysUserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


@Mapper
public interface SysRoleMapper {

    //查询所有
    @Select("select * from sys_role")
    List<SysRole> all();

    //分页
    List<SysRole> list(String key);

    //新增
    void add(SysRole sysRole);

    void addBridgeUser(SysUserRole sysUserRole);

    //修改
    @Update("update sys_role set " +
            "role_name=#{roleName},remark=#{remark},create_user_id=#{createUserId},create_time=#{createTime} " +
            "where role_id=#{roleId}")
    void update(SysRole sysRole);

    //删除
    void delete(Integer id);

    void deleteBridgeUser(Integer id);
}
